package com.leapp.sk.ui.activity.personal

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.ui.activity.login.MobileVerificationActivity
import com.example.util.finallist.CHANGE_PHONE
import com.leapp.sk.viewdelegate.personal.ChangePhoneDelegate

/**
 * 更换手机号
 * @author  chaohaipeng  on 2018/8/8.
 */
class ChangePhoneActivity : BaseActivityMVP<ChangePhoneDelegate>() {

    override fun initDate() {
        val stringExtra = intent?.getStringExtra(CHANGE_PHONE)
        viewDelegate.setPhone(stringExtra)
    }

    override fun bindEvenListener() {
        viewDelegate.setOnClickListener(View.OnClickListener {
            val intent= Intent(this, MobileVerificationActivity::class.java)
            intent.putExtra(CHANGE_PHONE,viewDelegate.getPhone())
            startActivity(intent)

        },R.id.tv_acp_change)


    }

    override fun getDelegateClass(): Class<ChangePhoneDelegate> {
        return ChangePhoneDelegate::class.java
    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_change_phone))
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }
}